#ifndef VQMLCOMPILER_H
#define VQMLCOMPILER_H

#include <QtDeclarative/QDeclarativeEngine>
#include <QtDeclarative/QDeclarativeError>

class VBlank;

class VQMLCompiler : public QObject
{
	Q_OBJECT

public:
	VQMLCompiler(QObject *parent=0);
	~VQMLCompiler();

public:
	// convert qml-engine error to row/columns in script
	static QPoint errorsToPos(const QList<QString>& errors);

public slots:
	QList<QDeclarativeError> errors() const;
	VBlank* execute(const QString& script, const QUrl& url = QUrl());

private slots:
	void qmlWarnings(const QList<QDeclarativeError>& w);

signals:
	void	warnings(const QList<QDeclarativeError>& w);

private:
	QList<QDeclarativeError> m_errors;
	std::tr1::shared_ptr<QDeclarativeEngine> m_qmlEngine;
	std::tr1::shared_ptr<QDeclarativeComponent> m_qmlComponent;	
	//QDeclarativeComponent* m_qmlComponent;
};

#endif // VQMLCOMPILER_H
